<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico"/>
    <link rel="Shortcut Icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${base}/lib/html5.js"></script>
    <script type="text/javascript" src="${base}/lib/respond.min.js"></script>
    <script type="text/javascript" src="${base}/lib/PIE-2.0beta1/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="${base}/res/lib/Hui-iconfont/1.0.7/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>小青蛙电子发票平台</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/css/malladmin.css"/>
</head>
<body>

<div class="page-container">
    <form method="get">
        <div class="text-l">
            姓名：
            <input type="text" id="RealName" name="RealName" class="input-text" style="width:150px" ,
                   placeholder="请输入姓名">
            手机号：
            <input type="text" id="Mobile" name="Mobile" class="input-text" style="width:150px" ,
                   placeholder="请输入手机号">
            单位：
            <input type="text" id="BCName" name="BCName" class="input-text" style="width:150px" ,
                   placeholder="请输入单位">
            状态：
            <span class="select-box inline">
                    <select id="State" name="State">
                    <#list userStautList?keys as key>
                        <option value="${userStautList["${key}"]}">${key}</option>
                    </#list>
                    </select>
            </span>
            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
            <span>
                    <a class="btn btn-primary radius"
                       onclick="bcompany_manangeradd('新增开票管理员', '${base}/bcompany/manageradd', '400', '300')"
                       href="javascript:;">
                        <i class="Hui-iconfont">&#xe600;</i>新增开票管理员
                    </a>
            </span>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="r">共有数据：<strong>10</strong> 条</span></div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                <tr class="text-c">
                    <th width="80">编号</th>
                    <th width="120">姓名</th>
                    <th width="120">用户名</th>
                    <th width="120">手机号</th>
                    <th width="120">单位</th>
                    <th width="60">状态</th>
                    <th width="80">管理操作</th>
                </tr>
                </thead>
                <tbody>
                <#list model.data as managerInfo>
                    <#assign state="${managerInfo.userstatus}" />
                <tr class="text-c">
                    <td>${managerInfo.uid}</td>
                    <td class="text-l">${managerInfo.userdetailInfo.realname}</td>
                    <td>${managerInfo.username}</td>
                    <td>${managerInfo.mobile}</td>
                    <td>${(managerInfo.bcompanyInfo.bcname)!""}</td>
                    <td>
                        <#if state == 1>
                            <span class="label label-success radius">启用</span>
                        <#else>
                            <span class="label radius">停用</span>
                        </#if>
                    </td>
                    <td class="td-manage">
                        <#if state == 1>
                            <a style="text-decoration:none" onclick="bcompany_manangerstop(this, ${managerInfo.uid})"
                               href="javascript:;">停用</a>
                        <#else>
                            <a style="text-decoration:none" onclick="bcompany_manangerenable(this, ${managerInfo.uid})"
                               href="javascript:;">启用</a>
                        </#if>
                    </td>
                </tr>
                </#list>
                </tbody>
            </table>
            <input type="hidden" id="BCId" value="${bcid}"/>
        </div>

    </form>

</div>
<script src="${base}/res/lib/jquery/1.9.1/jquery.js"></script>
<script src="${base}/res/lib/layer/2.1/layer.js"></script>

<script src="${base}/res/static/h-ui/js/H-ui.js"></script>
<script src="${base}/res/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--业务脚本-->
<script>
    //新增开票管理员
    function bcompany_manangeradd(title, url, w, h) {
        layer_show(title, url, w, h);
    }

    /*开票管理员-停用*/
    function bcompany_manangerstop(obj, uid) {
        layer.confirm('确认要停用吗？', function (index) {
            //此处请求后台程序，下方是成功后的前台处理……
            $.get("${base}/bcompany/managerstateupdate/" + uid + "?userstatus=0", function (data) {
                var result = data;
                if (result.code>=0) {
                    //刷新页面
                    location.replace(location.href);
                }
                else {
                    layer.msg(result.message);
                }
            })

        });
    }

    /*开票管理员-启用*/
    function bcompany_manangerenable(obj, uid) {
        layer.confirm('确认要启用吗？', function (index) {
            $.get("${base}/bcompany/managerstateupdate/" + uid + "?userstatus=1", function (data) {
                var result = data;
                if (result.code>=0) {
                    //刷新页面
                    location.replace(location.href);
                }
                else {
                    layer.msg(result.message);
                }
            })
        });
    }
</script>
</body>
</html>